﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Nb.Common
{
    [TestClass]
    public class CSharpTest
    {
        [TestMethod]
        public void System_IO_Path_GetFileNameWithoutExtension_Test()
        {
            const string layoutPath = @"~/a/b/c/_layout.cshtml";
            var layoutNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(layoutPath);
            Assert.AreEqual(@"_layout", layoutNameWithoutExtension);
        }
        [TestMethod]
        public void Hash_Code_Test()
        {
            for (int i = 0; i < 3; i++)
            {
                var obj = new MyClass();
                var obj2 = new MyClass();
                Console.WriteLine(obj.GetHashCode());
                Console.WriteLine(obj2.GetHashCode());
                Assert.AreNotEqual(obj.GetHashCode(), obj2.GetHashCode());
            }

        }

        public class MyClass
        {
            public string Name { get; set; }
            public int Age { get; set; }
        }

    }
}
